package com.cupdata.zicon.ch1_10;

import java.util.Random;

public class MyThread2 extends Thread{

	@Override
	public void run() {
//		System.out.println("MyThread2 run priority=" + this.getPriority());
//		MyThread2 thread2 = new MyThread2();
//		thread2.start();
		
		long beginTime = System.currentTimeMillis();
		long addResult = 0;
		for(int j = 0;j<10;j++) {
			for (int i = 0;i<50000;i++) {
				Random random = new Random();
				random.nextInt();
				addResult = addResult + i;
			}
		}
		long endTime = System.currentTimeMillis();
		System.out.println("thread 2 use time =" + (endTime - beginTime));
	}

	
}
